<?php


namespace app\blog\validate;


use think\Validate;

class GoodsValidate extends Validate
{
    protected $rule = [
        'id' => 'require|integer',
        'image' => 'require',
        'name' => 'require',
        'booklet' => 'require',
        'freight' => 'require',
        'gid' => 'require|integer',
//        'status' => 'require|integer',
    ];
    protected $message = [
        'id.require' => 'id不能为空',
        'id.integer' => 'id参数错误',
//        'image.image' => '图像参数错误',
        'image.require' => '图像不能为空',
        'name.require' => '名称不能为空',
//        'source.require' => '自营不能为空',
        'booklet.require' => '图册不能为空',
        'freight.require' => '运费不能为空',
        'gid.require' => '分类id不能为空',
        'gid.integer' => '分类id参数错误',

    ];
    protected $scene = [
        'add' => ['image','name','source'],
        'edit' => ['id','image','name','source'],
    ];
}